﻿using System;
using System.ServiceModel;
using System.ServiceModel.Description;
using ServiceLibrary;

namespace WCFServer
{
    class Program
    {
        static void Main(string[] args)
        {
            using (ServiceHost host = new ServiceHost(typeof(PumpStationService)))
            {
                /*host.AddServiceEndpoint(typeof (IPumpStationService), new WSDualHttpBinding(),
                    new Uri("http://localhost:8080/PumpStationService"));
                host.AddServiceEndpoint(typeof (IPumpStationService), new NetTcpBinding(),
                    new Uri("net.tcp://localhost:12345/PumpStationService"));
                host.AddServiceEndpoint(typeof (ICentralService), new NetTcpBinding(),
                    new Uri("net.tcp://localhost:12345/CentralService"));*/

                host.AddServiceEndpoint(typeof (IPumpStationService), new NetTcpBinding(),
                    new Uri("net.tcp://127.0.0.1:8081/PumpStationService"));
                host.AddServiceEndpoint(typeof (ICentralTerminalService), new NetTcpBinding(),
                    new Uri("net.tcp://127.0.0.1:8081/CentralTerminalService"));
                /*host.AddServiceEndpoint(typeof (IMetadataExchange), new BasicHttpBinding(),
                    new Uri("http://127.0.0.1:8080/mex"));*/

                host.Open();
                Console.WriteLine("Service running...");
                Console.ReadLine();
                host.Close();
            }
        }
    }
}
